From 9f3c3daaedda9e5919ba3d48062139cbc0df4b78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 2 Jul 2009 08:20:56 +0000 Subject: [PATCH] (xg_frame_set_char_size): Do not set pixel width/height here or call change_frame_size. Just call flush_and_sync. (flush_and_sync): Reintroduced. --- src/ChangeLog | 5 +++-- src/gtkutil.c | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 14ac4c01353..3e21453ad2c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,8 @@ 2009-07-02 Jan Djärv - * gtkutil.c (xg_frame_set_char_size): Do not set pixel width/height here or - call change_frame_size. + * gtkutil.c (xg_frame_set_char_size): Do not set pixel width/height + here or call change_frame_size. Just call flush_and_sync. + (flush_and_sync): Reintroduced. 2009-07-01 Jan Djärv diff --git a/src/gtkutil.c b/src/gtkutil.c index 4ce15ae8cc3..2bca0deac2c 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -636,6 +636,7 @@ xg_frame_resized (f, pixelwidth, pixelheight) FRAME_PTR f; int pixelwidth, pixelheight; { + fprintf(stderr, "%s: %d/%d\n", __func__, pixelwidth, pixelheight); int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight); int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth); @@ -654,6 +655,20 @@ xg_frame_resized (f, pixelwidth, pixelheight) } } +static void +flush_and_sync (f) + FRAME_PTR f; +{ + gdk_window_process_all_updates (); + x_sync (f); + while (gtk_events_pending ()) + { + gtk_main_iteration (); + gdk_window_process_all_updates (); + x_sync (f); + } +} + /* Resize the outer window of frame F after chainging the height. COLUMNS/ROWS is the size the edit area shall have after the resize. */ @@ -697,8 +712,7 @@ xg_frame_set_char_size (f, cols, rows) request, XMonad does this all the time. The best we can do is try to sync, so lisp code sees the updated size as fast as possible. */ - gdk_window_process_all_updates (); - x_sync (f); + flush_and_sync (f); } /* Handle height changes (i.e. add/remove menu/toolbar). -- 2.30.2